<?php

session_start();
error_reporting(E_ALL &~ E_NOTICE);
//if( isset($_SESSION['last_key']) ) header("Location: weibolist.php");
include_once( 'config.php' );
include_once( 'weibooauth.php' );



$o = new WeiboOAuth( WB_AKEY , WB_SKEY  );

$keys = $o->getRequestToken();
$aurl = $o->getAuthorizeURL( $keys['oauth_token'] ,false , 'http://'.$_SERVER['HTTP_HOST'].'/cgi/sina/callback.php?q='.$_GET['q']);

$_SESSION['app_keys_sina'] = $keys;

header('Location: '.$aurl);
?>